<template>
  <div class="main-box">
    <div class="header-box">
      <div class="header-title">
        <a-page-header
            title="交易数据"
        />
        <div class="nearly">
          近六个月
        </div>
      </div>

<!-- 状态板-->
      <div class="boardcast">
        <a-card class="card" v-for="item in boardCastData"
                :style="{'flex': 1,
                'margin': '0 10px','background':item.background}" >
          <a-statistic class="number" :value="item.num" />
          <p class="title">{{item.title}}</p>
          <a-icon
              class="boardcast-icon"
              :type="item.icon"></a-icon>
        </a-card>
      </div>
    </div>

    <div class="middle mt24">
      <div class="left-box">
        <div class="content-box">
          <div class="header">
<!--头部内容 -->
            <div class="title">
              <a-page-header
                  class="titleText"
                  title="订单数据"
              />
            </div>
            <div class="header-tabs">
              <a-tabs
                  v-model="orderActiveIndex"
                  @change="orderChange()"
                  default-active-key="1">
                <a-tab-pane key="1" tab="今日">
                </a-tab-pane>
                <a-tab-pane key="2" tab="昨日">
                </a-tab-pane>
                <a-tab-pane key="3" tab="最近七日">
                </a-tab-pane>
              </a-tabs>
            </div>
          </div>
          <div class="content">
              <div class="orderEcharts">
                123
              </div>
              <div class="orderInfo">
                <ul class="orderList">

                  <li class="orderListItem" v-for="item in 3">
                    {{item}}
                    <div class="orderListItemIcon flex-center">
                      <div class="icon-box">
                        <a-icon type="clock-circle" />
                      </div>
                    </div>
                    <div class="orderListItemMiddle">
                      <div class="num">
                        60/1k
                      </div>
                      <div class="title">
                        成交量/交易量(伪)
                      </div>
                    </div>
                    <div class="orderInfoData">
                      <div class="data-box">
                        <span>日环比50</span>
                      </div>
                    </div>

                  </li>
                </ul>
              </div>
          </div>
        </div>
      </div>
      <div class="right-box ml24">

      </div>
    </div>
  </div>
</template>

<script>
export default {
  name: "index",
  data() {
    return {
      boardCastData: [
        {
          title: '交易额(元)',
          num: '898832100',
          icon: 'transaction',
          background: '#ff4d4f'
        },
        {
          title: '待发货订单',
          num: '1980000',
          icon: 'rocket',
          background: '#3498db'
        },
        {
          title: '待付款订单',
          num: '32100',
          icon: 'file-excel',
          background: '#2ecc71'
        },
        {
          title: '维权订单',
          num: '210',
          icon: 'fire',
          background: '#e67e22'
        },
      ],
      orderActiveIndex:"1",
      fakeData:[
        {text:'test测试test测试'},
        {text:'test测试test测试'},
        {text:'test测试test测试'},

      ]
    }
  },
  methods:{
    orderChange(){
      console.log(this.orderActiveIndex);
    }
  }
}
</script>

<style lang="less" scoped>
.main-box {
  height: 100%;
  width: 100%;
}
.header-box {
  background: #ffffff;
  padding: 10px;
  .header-title {
    display: flex;
    justify-content: space-between;
    align-items: center;

    .nearly {
      color: #c9c9c9;
      font-size: 14px;
    }
  }

  .boardcast {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 20px;
    .card {
      position: relative;
      height: 113px;
/*      /deep/ .ant-card-body {
        padding: 10px 24px;
      }*/
      .number {
        margin-top: -10px;
      }
      /deep/ .ant-statistic-content-value-int {
        font-size: 20px;
        color: white !important;
        font-family: 微软雅黑;
        padding-bottom: 10px;
      }
      .title {
        color: white;
      }
      .boardcast-icon {
        position: absolute;
        font-size: 30px;
        color: rgba(255,255,255,.5);
        top: 10px;
        right: 10px;
      }
    }
  }
}
.middle {
  width: 100%;
  height: 50%;
  //background: #fff;
  display: flex;
  //padding:10px;
  .left-box {
    width: 35%;
    background: #fff;
    .content-box {
      height: 100%;
      width: 100%;
      padding: 10px;
      .header {
          display: flex;
        .title {
          width: 40%;
          height: 50px;
          display: flex;
          justify-content: flex-start;
          align-items: center;
          margin-bottom: 16px; //对齐右边的tab 的 16px
        }
        .header-tabs {
          flex: 1;
        }
      }
      .content {
        width: 100%;
        height: calc(100% - 66px);  //title 50px + margin-bottom 16px = 66px
        background: #1890ff;
        display: flex;
        flex-direction: column;
        .orderEcharts {
          width: 100%;
          height: 40%;
          background: darksalmon;
        }
        .orderInfo {
          flex: 1;
          .orderList {
            height: 100%;
            display: flex;
            flex-direction: column;
            .orderListItem {
              background: seagreen;
              padding: 5px 10px;
              display: flex;
              flex: 1;
              .orderListItemIcon {
                flex: 1;

              }
            }
          }
        }
      }
    }
  }
  .right-box {
    flex: 1;
    background: #ffffff;
  }

}

.ant-page-header {
  padding: 0 0 0 10px;
}
</style>